refactor: build option-relation rulebase via copy-rulebase#3
Merged
Conversation
make-option-relation-rulebase reconstructed a fresh rulebase from *option-relation-rules*'s visible clauses by hand. cl-prolog exposes copy-rulebase for exactly this (a detached copy including full runtime state, not just clauses), so use it instead of hand-rolling the same result from rulebase-visible-clauses. Recovered while auditing every branch/worktree in this checkout for fixes that never made it to main: this was one half of 159eb01 "ci: enforce dogfood coverage thresholds" on the feat/cl-prolog-cl-weave reference branch. The other half of that commit (a coverage-threshold CI gate) targets cl-weave APIs (make-coverage-summary, ensure-coverage-thresholds, coverage-summary-plist) that no longer exist in the cl-weave version main now depends on, so it isn't a like-for-like port and is left out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensively audited every branch and worktree in this checkout
(
main,feat/cl-prolog-cl-weave,feat/cl-prolog-weave,feat/ci-ubuntu-only,feat/cl-prolog-cl-weave-integration, plus the fourlocal worktrees) for fixes that never made it into
main, now that PR #2landed the cl-prolog/cl-weave dogfood integration. This is the one thing
that survived the filter as a genuinely useful, verified, low-risk,
not-already-covered fix.
make-option-relation-rulebasenow usescl-prolog:copy-rulebaseinstead of hand-reconstructing a rulebase via
make-rulebase+rulebase-visible-clauses.copy-rulebaseis the library's owndetached-copy primitive (clauses and full runtime state — operator
tables, flags, module/source registries), so this is both simpler and
more robust than re-deriving the same result from a narrower accessor.
Behavior-preserving; confirmed via the full test suite.
What else I found and why it's excluded
feat/ci-ubuntu-only, and thea8b7cf2/0700837commits unique tofeat/cl-prolog-weave— no unique content; fully subsumed by what'salready on
main(or an empty checkpoint commit).7b65686"build: unify cl-weave input" (dedup a nested flake input) —fixes a problem specific to the old flake.nix shape (
cl-prologas aproper flake input with
.packages.${system}.default). Main's currentflake.nix fetches
cl-weave/cl-prologas plain (flake = false)sources via
.outPathinstead, so the duplicate-input problem thiscommit fixes doesn't exist here.
5bdd5e2"fix: stabilize option relation ordering" (topological sortvia Kahn's algorithm) — targets the same non-deterministic-comparator
bug that PR feat: dogfood cl-prolog/cl-weave with option groups, perf, and hardening #2 already fixed on
main, via a different (cheaper,closure-size-based) comparator. Verified
main's currentvalidate-option-relationshipsalready handles a 3-level transitive:requireschain correctly, so re-doing the fix via topological sortwould just be a redundant, more expensive alternative — not a gap.
159eb01"ci: enforce dogfood coverage thresholds" (the other half ofthis commit, unlike the
copy-rulebasechange) — adds ansb-cover-based coverage-threshold gate toflake.nix. It callscl-weave:make-coverage-summary,cl-weave:ensure-coverage-thresholds,and
cl-weave:coverage-summary-plist, none of which exist in thecl-weaveversionmainnow depends on (its coverage API is nowcoverage-statistics/reset-coverage/save-coverageinstead).Porting this would mean writing new code against an API I can't fully
validate locally (no Linux nix builder on this machine), so it's left
out rather than shipped unverified. Worth a follow-up if coverage
gating in CI is still wanted.
dependabot/github_actions/actions/checkout-7(open PR chore(deps): bump actions/checkout from 4 to 7 #1) — routineDependabot maintenance; left for Dependabot to manage rather than
folded in here.
cl-cli-worktreescratch worktree — untracked files only, nocommits, and older than every other snapshot examined (missing
src/option-relations.lispentirely). Nothing to recover from it.Test plan
sbcl --non-interactive --load tests/run-tests.lisp --eval '(cl-cli/tests:run-tests)' --quit(withCL_WEAVE_SOURCE_DIR/CL_PROLOG_SOURCE_DIRpointed at sibling checkouts) →172 passed, 0 failed, 0 errored.